<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<div class="layui-container" th:fragment="form(submitBtnText)">
    <div class="layui-form layuimini-form">
        <div class="layui-row layui-col-space10">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label required">用户名</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" lay-verify="required" lay-reqtext="用户名不能为空"
                               placeholder="请输入用户名" class="layui-input"
                               th:value="${model != null ? model.name : ''}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="password" lay-verify="required" lay-reqtext="密码不能为空"
                               placeholder="请输入密码" class="layui-input"
                               th:value="${model != null ? model.password : ''}">
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-row layui-col-space10">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">角色</label>
                    <div class="layui-input-block">
                        <input type="text" name="roleId" lay-verify="required" lay-reqtext="角色不能为空"
                               placeholder="请输入角色" class="layui-input"
                               th:value="${model != null ? model.roleId : ''}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label required">手机</label>
                    <div class="layui-input-block">
                        <input type="text" name="phone" lay-verify="required|phone" lay-reqtext="手机不能为空"
                               placeholder="请输入手机" class="layui-input"
                               th:value="${model != null ? model.phone : ''}">
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-row layui-col-space10">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">邮箱</label>
                    <div class="layui-input-block">
                        <input type="email" name="email" lay-verify="email" placeholder="请输入邮箱" class="layui-input"
                               th:value="${model != null ? model.email : ''}">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
            </div>
        </div>

        <div class="layui-row layui-col-space10">
            <div class="layui-col-md6">
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">备注信息</label>
                    <div class="layui-input-block">
                        <textarea name="remark" class="layui-textarea" placeholder="请输入备注信息"
                                  th:text="${model != null ? model.remark : ''}">
                        </textarea>
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
            </div>
        </div>

        <input type="hidden" name="id" th:if="${model} != null" th:value="${model != null ? model.id : ''}">

        <div class="layui-row layui-col-space10">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn" th:text="${submitBtnText}"></button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</html>